package com.ebupt.migu.music.outside.controller;

import com.ebupt.migu.music.common.entity.ResultObject;
import com.ebupt.migu.music.common.util.ReqestParamUtil;
import com.ebupt.migu.music.outside.service.CMSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Created by Intellij IDEA.
 * User:  liuyangyang@cd.ebupt.com
 * Date:  2019/9/25
 */
@RestController
@RequestMapping("/cms")
public class CMSController {

    @Autowired
    private HttpServletRequest request;
    @Autowired
    private CMSService cmsService;

    /**
     * 查询活动列表
     * @return
     */
    @GetMapping(value = "/activities")
    public ResultObject activities() {
        Map<String, Object> params = ReqestParamUtil.getParams(request);
        return cmsService.activities(params);
    }

}
